import 'package:flutter_eve_plugin/model/ye_xiu/rank/rank_info.dart';
import 'package:flutter_eve_plugin/store/base_action.dart';
import 'package:flutter_eve_plugin/utils/print_util.dart';

import 'constant.dart';

yexiuRank(store, RankInfo rankInfo) {
  if (rankInfo.data.type.isNotEmpty) {
    logDebugPrint('type = ${rankInfo.data.type}');
    if (rankInfo.data.type == "role") {
      userRoleRank(store,rankInfo);
    } else if (rankInfo.data.type == "weapon") {
      userWeaponRank(store,rankInfo);
    }
  }
}

userCoinRank(store, RankInfo rankInfo) {
  logDebugPrint('userCoinRank == ');
  store.dispatch(BaseAction(type: RANKING_COIN, data: rankInfo));
}

userWeaponRank(store, RankInfo rankInfo) {
  logDebugPrint('userWeaponRank == ');
  store.dispatch(BaseAction(type: RANKING_WEAPON, data: rankInfo));
}

userRoleRank(store, RankInfo rankInfo) {
  logDebugPrint('userRoleRank == ');
  store.dispatch(BaseAction(type: RANKING_ROLE, data: rankInfo));
}

userAbilityRank(store, RankInfo rankInfo) {
  logDebugPrint('userAbilityRank == ');
  store.dispatch(BaseAction(type: RANKING_ABILITY, data: rankInfo));
}
